package com.cskaoyan.relation;

import java.util.ArrayList;

/**
 * @author stone
 * @date 2022/06/28 10:28
 */
public class RelationExecution {

    public static void main(String[] args) {
        SecurityManager securityManager = new SecurityManager();

        ArrayList<Realm> realms = new ArrayList<>();
        realms.add(new Realm());
        realms.add(new Realm());
        realms.add(new Realm());

        securityManager.setRealms(realms);

        //如果SecurityManager中使用的是自定义的认证器
        Authenticator authenticator = new Authenticator();
        // 需要你给自定义的认证器单独提供对应的realm
        //authenticator.setRealms();
        securityManager.setAuthenticator(authenticator);
    }
}
